package com.study.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * 小程序配置
 *
 * @Author hupengming
 * @ClassName
 * @Date 2022-11-14 16:18
 * @Version 1.0
 */
@Data
@Configuration
public class MiniConfig {

    @Value(value = "${mini.workModel:null}")
    private String workModel;

    @Value(value = "${mini.appid:null}")
    private String appid;

    @Value(value = "${mini.secret:null}")
    private String secret;

    public boolean isNative() {
        if (workModel.compareTo("native") == 0) {
            return true;
        }
        return false;
    }

    public boolean isComponentModel() {
        if (this.workModel.compareTo("component") == 0) {
            return true;
        }
        return false;
    }
}
